<?php

namespace  Aitels\Foundation\Route;


use  Aitels\Foundation\Annotation\ApplicationAnnotationsContainer;
use  Aitels\Foundation\Annotation\RouteAnnotation;


class AnnotationRouteRegister
{
    protected $routeDefinitionProvider;

    public function register()
    {
        $builder = new RouteBuilder;
        $routeAnnotations = ApplicationAnnotationsContainer::getApplicationAnnotations(RouteAnnotation::NAME);
        foreach ($routeAnnotations as $classPath => $methodsAnnotations)
            foreach ($methodsAnnotations as $methodName => $methodAnnotations) {
                foreach ($methodAnnotations as $routeAnnotation)
                    $builder->buildRoute($classPath, $methodName, $routeAnnotation);
            }
    }

}